home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 17322 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  753 b 

  1. Path: news1.intercall.com!usenet
  2. From: engevar@intercall.com (Steven Ovits)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Copy constructor
  5. Date: Mon, 15 Apr 1996 12:33:31 GMT
  6. Organization: Intercall Inc.
  7. Message-ID: <4kt6b9$9a4@news1.intercall.com>
  8. References: <4kjudi$2qj0@holly.ACNS.ColoState.EDU> <316EE05E.72F7@braunschweig.netsurf.de>
  9. NNTP-Posting-Host: 206.98.168.162
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12. Corby S. Hudnall wrote:
  13. > Hi all, I'm having some trouble figuring out how to do a copy
  14. > constructor.  Here's what I thought was suppose to work:
  15. [stuff deleted]
  16. > ABC::ABC(const ABC& NewABC)
  17. > {
  18. >    this->AnInt = NewABC->AnInt;
  19. > }
  20.  
  21. You need to use the dot operator on a reference.
  22. Use  AnInt = NewABC.AnInt;
  23. or   this->AnInt = NewABC.AnInt;
  24.  
  25.  
  26.